import React from 'react';
import ReactDOM from 'react-dom';
import registerServiceWorker from './registerServiceWorker';
import thunk from 'redux-thunk'
import {BrowserRouter as Router,Link,Route,Redirect,Switch} from 'react-router-dom'
import {Provider} from 'react-redux'
import  {createStore,applyMiddleware,compose} from 'redux'
// import  Register from './container/register/register'
// import  Login from './container/login/login'
// import  AuthRoute from './components/authRoute/authRouth'
// import  BossInfo from './container/bossinfo/bossinfo'
// import  Geniusinfo from './container/geniusinfo/geniusinfo'
// import  Chat from './components/chat/chat'
// import  Dashboard from './components/dashboard/dashboard'
import App from './app'
import  reducers from './reducer'//合并reducer
import  './config.js'
import 'antd-mobile/dist/antd-mobile.css'; 
import  './index.css' 

const store =createStore(reducers,compose(applyMiddleware(thunk),
window.devToolsExtension?window.devToolsExtension():f=>f
))
    ReactDOM.hydrate(
        (<Provider store={store} >
        <Router>
            <App></App>
            {/* <div className='wrapper'>
                <AuthRoute></AuthRoute>
                
                    <Switch>
                        <Route path='/bossinfo' component={BossInfo}></Route>
                        <Route path='/geniusinfo' component={Geniusinfo}></Route>
                        <Route path='/login' component={Login}></Route>
                        <Route path='/register' component={Register}></Route>
                        <Route path='/chat/:user' component={Chat}></Route>
                    
                        <Route component={Dashboard}></Route>
                    
                    </Switch>
                
                
            </div> */}
        </Router>
         </Provider>)
    , document.getElementById('root'));
registerServiceWorker();
